;;;; -*- mode: Scheme; -*-

(define-ftype SDL_SysWMinfo      void*)
(define-ftype SDL_Cursor         void*)
(define-ftype SDL_Joystick       void*)
(define-ftype SDL_GameController void*)
(define-ftype SDL_Haptic         void*)
(define-ftype SDL_Window         void*)
(define-ftype SDL_Renderer       void*)
(define-ftype SDL_Texture        void*)
(define-ftype SDL_GLContext      void*)

(define-ftype SDL_version
  (struct (major unsigned-8)
	  (minor unsigned-8)
	  (patch unsigned-8)))

(define-ftype SDL_Keysym
  (struct (scancode unsigned)
	  (sym      integer-32)
	  (mod      unsigned-16)
	  (unused   unsigned-32)))

(define-ftype SDL_CommonEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)))

(define-ftype SDL_WindowEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (event     unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)
	  (padding3  unsigned-8)
	  (data1     integer-32)
	  (data2     integer-32)))

(define-ftype SDL_KeyboardEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (state     unsigned-8)
	  (repeat    unsigned-8)
	  (keysym    SDL_Keysym)))

(define-ftype SDL_TextEditingEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (text      (array 32 char))
	  (start     integer-32)
	  (length    integer-32)))

(define-ftype SDL_TextInputEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (text      (array 32 char))))

(define-ftype SDL_MouseMotionEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (which     unsigned-32)
	  (state     unsigned-32)
	  (x         integer-32)
	  (y         integer-32)
	  (xrel      integer-32)
	  (yrel      integer-32)))

(define-ftype SDL_MouseButtonEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (which     unsigned-32)
	  (button    unsigned-8)
	  (state     unsigned-8)
	  (clicks    unsigned-8)
	  (padding1  unsigned-8)
	  (x         integer-32)
	  (y         integer-32)))

(define-ftype SDL_MouseWheelEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (which     unsigned-32)
	  (x         integer-32)
	  (y         integer-32)
	  (direction unsigned-32)))

(define-ftype SDL_JoyAxisEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (axis      unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)
	  (padding3  unsigned-8)
	  (value     integer-16)
	  (padding4  unsigned-16)))

(define-ftype SDL_JoyBallEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (ball      unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)
	  (padding3  unsigned-8)
	  (xrel      integer-16)
	  (yrel      integer-16)))

(define-ftype SDL_JoyHatEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (hat       unsigned-8)
	  (value     unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)))

(define-ftype SDL_JoyButtonEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (button    unsigned-8)
	  (state     unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)))

(define-ftype SDL_JoyDeviceEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)))

(define-ftype SDL_ControllerAxisEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (axis      unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)
	  (padding3  unsigned-8)
	  (value     unsigned-16)
	  (padding4  unsigned-16)))

(define-ftype SDL_ControllerButtonEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)
	  (button    unsigned-8)
	  (state     unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)))

(define-ftype SDL_ControllerDeviceEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     integer-32)))

(define-ftype SDL_AudioDeviceEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (which     unsigned-32)
	  (iscapture unsigned-8)
	  (padding1  unsigned-8)
	  (padding2  unsigned-8)
	  (padding3  unsigned-8)))

(define-ftype SDL_QuitEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)))

(define-ftype SDL_UserEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (windowID  unsigned-32)
	  (code      integer-32)
	  (data1     void*)
	  (data2     void*)))

(define-ftype SDL_SysWMEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (msg       void*)))

(define-ftype SDL_TouchFingerEvent
  (struct (type      unsigned-32)
	  (timestamp unsigned-32)
	  (touchId   integer-64)
	  (fingerId  integer-64)
	  (x         float)
	  (y         float)
	  (dx        float)
	  (dy        float)
	  (pressure  float)))

(define-ftype SDL_MultiGestureEvent
  (struct (type       unsigned-32)
	  (timestamp  unsigned-32)
	  (touchId    integer-64)
	  (dTheta     float)
	  (dDist      float)
	  (x          float)
	  (y          float)
	  (numFingers unsigned-16)
	  (padding    unsigned-16)))

(define-ftype SDL_DollarGestureEvent
  (struct (type       unsigned-32)
	  (timestamp  unsigned-32)
	  (touchId    integer-64)
	  (gestureId  integer-64)
	  (numFingers unsigned-32)
	  (error      float)
	  (x          float)
	  (y          float)))

(define-ftype SDL_DropEvent
  (struct (type       unsigned-32)
	  (timestamp  unsigned-32)
	  (file       (* char))
	  (windowID   unsigned-32)))

(define-ftype SDL_Event
  (union (type     unsigned-32)
	 (common   SDL_CommonEvent)
	 (window   SDL_WindowEvent)
	 (key      SDL_KeyboardEvent)
	 (edit     SDL_TextEditingEvent)
	 (text     SDL_TextInputEvent)
	 (motion   SDL_MouseMotionEvent)
	 (button   SDL_MouseButtonEvent)
	 (wheel    SDL_MouseWheelEvent)
	 (jaxis    SDL_JoyAxisEvent)
	 (jball    SDL_JoyBallEvent)
	 (jhat     SDL_JoyHatEvent)
	 (jbutton  SDL_JoyButtonEvent)
	 (jdevice  SDL_JoyDeviceEvent)
	 (caxis    SDL_ControllerAxisEvent)
	 (cbutton  SDL_ControllerButtonEvent)
	 (cdevice  SDL_ControllerDeviceEvent)
	 (adevice  SDL_AudioDeviceEvent)
	 (quit     SDL_QuitEvent)
	 (user     SDL_UserEvent)
	 (syswm    SDL_SysWMEvent)
	 (tfinger  SDL_TouchFingerEvent)
	 (mgesture SDL_MultiGestureEvent)
	 (dgesture SDL_DollarGestureEvent)
	 (drop     SDL_DropEvent)
	 (padding  (array 56 unsigned-8))))

(define-ftype SDL_HapticDirection
  (struct (type unsigned-8)
	  (dir  (array 3 integer-32))))

(define-ftype SDL_HapticConstant
  (struct (type          unsigned-16)
	  (direction     SDL_HapticDirection)
	  (length        unsigned-32)
	  (delay         unsigned-16)
	  (button        unsigned-16)
	  (interval      unsigned-16)
	  (level         integer-16)
	  (attack_length unsigned-16)
	  (attack_level  unsigned-16)
	  (fade_length   unsigned-16)
	  (fade_level    unsigned-16)))

(define-ftype SDL_HapticPeriodic
  (struct (type          unsigned-16)
	  (direction     SDL_HapticDirection)
	  (length        unsigned-32)
	  (delay         unsigned-16)
	  (button        unsigned-16)
	  (interval      unsigned-16)
	  (period        unsigned-16)
	  (magnitude     integer-16)
	  (offset        integer-16)
	  (phase         unsigned-16)
	  (attack_length unsigned-16)
	  (attack_level  unsigned-16)
	  (fade_length   unsigned-16)
	  (fade_level    unsigned-16)))

(define-ftype SDL_HapticCondition
  (struct (type          unsigned-16)
	  (direction     SDL_HapticDirection)
	  (length        unsigned-32)
	  (delay         unsigned-16)
	  (button        unsigned-16)
	  (interval      unsigned-16)
	  (right_sat     (array 3 unsigned-16))
	  (left_sat      (array 3 unsigned-16))
	  (right_coeff   (array 3 integer-16))
	  (left_coeff    (array 3 integer-16))
	  (deadband      (array 3 unsigned-16))
	  (center        (array 3 integer-16))))

(define-ftype SDL_HapticRamp
  (struct (type          unsigned-16)
	  (direction     SDL_HapticDirection)
	  (length        unsigned-32)
	  (delay         unsigned-16)
	  (button        unsigned-16)
	  (interval      unsigned-16)
	  (start         integer-16)
	  (end           integer-16)
	  (attack_length unsigned-16)
	  (attack_level  unsigned-16)
	  (fade_length   unsigned-16)
	  (fade_level    unsigned-16)))

(define-ftype SDL_HapticLeftRight
  (struct (type            unsigned-16)
	  (length          unsigned-32)
	  (large_magnitude unsigned-16)
	  (small_magnitude unsigned-16)))

(define-ftype SDL_HapticCustom
  (struct (type          unsigned-16)
	  (direction     SDL_HapticDirection)
	  (length        unsigned-32)
	  (delay         unsigned-16)
	  (button        unsigned-16)
	  (interval      unsigned-16)
	  (channels      unsigned-8)
	  (period        unsigned-16)
	  (samples       unsigned-16)
	  (data          (* unsigned-16))
	  (attack_length unsigned-16)
	  (attack_level  unsigned-16)
	  (fade_length   unsigned-16)
	  (fade_level    unsigned-16)))

(define-ftype SDL_HapticEffect
  (struct (type       unsigned-16)
	  (constant   SDL_HapticConstant)
	  (periodic   SDL_HapticPeriodic)
	  (condition  SDL_HapticCondition)
	  (ramp       SDL_HapticRamp)
	  (left_right SDL_HapticLeftRight)
	  (custom     SDL_HapticCustom)))

(define-ftype SDL_Finger
  (struct (id       integer-64)
	  (x        float)
	  (y        float)
	  (pressure float)))

(define-ftype SDL_JoystickGUID
  (struct (data (array 16 unsigned-8))))

(define-ftype SDL_GameControllerButtonBind
  (struct (bindType int)
	  (value (union (button int)
			(axis int)
			(hat (struct (hat      int)
				     (hat_mask int)))))))

(define-ftype SDL_Rect
  (struct (x int)
	  (y int)
	  (w int)
	  (h int)))

(define-ftype SDL_FRect
  (struct (x float)
	  (y float)
	  (w float)
	  (h float)))

(define-ftype SDL_Point
  (struct (x int)
	  (y int)))

(define-ftype SDL_FPoint
  (struct (x float)
	  (y float)))

(define-ftype SDL_Color
  ;; 改成int之后,ttf的render,依然颜色随机
  (struct (r unsigned-8)
	  (g unsigned-8)
	  (b unsigned-8)
	  (a unsigned-8)))

(define-ftype SDL_Palette
  (struct (ncolors  int)
	  (colors   (* SDL_Color))
	  (version  unsigned-32)
	  (refcount int)))

(define-ftype SDL_PixelFormat
  ;; thunder单独用了一个文件pixels-types.ss 定义 sdl-pixel-format-t ,color和palette都是前奏
  ;; 
  (struct (format        unsigned-32)
	  (palette       (* SDL_Palette))
	  (BitsPerPixel  unsigned-8)
	  (BytesPerPixel unsigned-8)
	  (padding       (array 2 unsigned-8))
	  (Rmask         unsigned-32)
	  (Gmask         unsigned-32)
	  (Bmask         unsigned-32)
	  (Amask         unsigned-32)
	  (Rloss         unsigned-8)
	  (Gloss         unsigned-8)
	  (Bloss         unsigned-8)
	  (Aloss         unsigned-8)
	  (Rshift        unsigned-8)
	  (Gshift        unsigned-8)
	  (Bshift        unsigned-8)
	  (Ashift        unsigned-8)
	  (refcount      int)
	  (next          (* SDL_PixelFormat))))

(define-ftype SDL_Surface
  (struct (flags     unsigned-32)
	  (format    (* SDL_PixelFormat))
	  (w         int)
	  (h         int)
	  (pitch     int)
	  (pixels    void*)		
	  (userdata  void*)
	  (locked    int)
	  (lock_data void*)
	  (clip_rect SDL_Rect)
	  (b_map     void*)
	  (refcount  int)))

(define-ftype SDL_DisplayMode
  (struct (format       unsigned-32)
	  (w            int)
	  (h            int)
	  (refresh_rate int)
	  (driverdata   void*)))

(define-ftype SDL_RendererInfo
  (struct (name                (* char))
	  (flags               unsigned-32)
	  (num_texture_formats unsigned-32)
	  (texture_formats     (array 16 unsigned-32))
	  (max_texture_width   int)
	  (max_texture_height  int)))

(define-ftype SDL_MessageBoxColor
  (struct (r unsigned-8)
	  (g unsigned-8)
	  (b unsigned-8)))

(define-ftype SDL_MessageBoxColorScheme
  (struct (colors (array 5 SDL_MessageBoxColor))))

(define-ftype SDL_MessageBoxButtonData
  (struct (flags    unsigned-32)
	  (buttonid int)
	  (text     (* char))))

(define-ftype SDL_MessageBoxData
  (struct (flags       unsigned-32)
	  (window      SDL_Window)
	  (title       (* char))
	  (message     (* char))
	  (numbuttons  int)
	  (buttons     (* SDL_MessageBoxButtonData))
	  (colorScheme (* SDL_MessageBoxColorScheme))))

(define-ftype SDL_AudioCallback
  (function (void* u8* int) void))

(define-ftype SDL_AudioFormat
  unsigned-16)

(define-ftype SDL_AudioSpec
  (struct (freq     int)
	  (format   SDL_AudioFormat)
	  (channels unsigned-8)
	  (silence  unsigned-8)
	  (samples  unsigned-16)
	  (padding  unsigned-16)
	  (size     unsigned-32)
	  (callback void*)
	  (userdata void*)))

(define-ftype SDL_AudioCVT
  (packed (struct (needed int)
		  (src_format   SDL_AudioFormat)
		  (dst_format   SDL_AudioFormat)
		  (rate_incr    double)
		  (buf          (* unsigned-8))
		  (len          int)
		  (len_cvt      int)
		  (len_mult     int)
		  (len_ratio    double)
		  (filters      (array 10 void*))
		  (filter_index int))))

(define-ftype SDL_AudioStream
  void*)

(define-ftype SDL_AudioDeviceID
  unsigned-32)

(define-ftype SDL_AudioFilter
  (function ((* SDL_AudioCVT) SDL_AudioFormat) void))

(define-ftype SDL_RWops
  ;; 这个定义比别的复杂很多,看起来还带了struct的递归定义
  void*)

;; Assumes little endian (i think)
(define SDL_PIXELFORMAT_UNKNOWN     #x00000000)
(define SDL_PIXELFORMAT_INDEX1LSB   #x11100100)
(define SDL_PIXELFORMAT_INDEX1MSB   #x11200100)
(define SDL_PIXELFORMAT_INDEX4LSB   #x12100400)
(define SDL_PIXELFORMAT_INDEX4MSB   #x12200400)
(define SDL_PIXELFORMAT_INDEX8      #x13000801)
(define SDL_PIXELFORMAT_RGB332      #x14110801)
(define SDL_PIXELFORMAT_RGB444      #x15120C02)
(define SDL_PIXELFORMAT_RGB555      #x15130F02)
(define SDL_PIXELFORMAT_BGR555      #x15530F02)
(define SDL_PIXELFORMAT_ARGB4444    #x15321002)
(define SDL_PIXELFORMAT_RGBA4444    #x15421002)
(define SDL_PIXELFORMAT_ABGR4444    #x15721002)
(define SDL_PIXELFORMAT_BGRA4444    #x15821002)
(define SDL_PIXELFORMAT_ARGB1555    #x15331002)
(define SDL_PIXELFORMAT_RGBA5551    #x15441002)
(define SDL_PIXELFORMAT_ABGR1555    #x15731002)
(define SDL_PIXELFORMAT_BGRA5551    #x15841002)
(define SDL_PIXELFORMAT_RGB565      #x15151002)
(define SDL_PIXELFORMAT_BGR565      #x15551002)
(define SDL_PIXELFORMAT_RGB24       #x17101803)
(define SDL_PIXELFORMAT_BGR24       #x17401803)
(define SDL_PIXELFORMAT_RGB888      #x16161804)
(define SDL_PIXELFORMAT_RGBX8888    #x16261804)
(define SDL_PIXELFORMAT_BGR888      #x16561804)
(define SDL_PIXELFORMAT_BGRX8888    #x16661804)
(define SDL_PIXELFORMAT_ARGB8888    #x16362004)
(define SDL_PIXELFORMAT_RGBA8888    #x16462004)
(define SDL_PIXELFORMAT_ABGR8888    #x16762004)
(define SDL_PIXELFORMAT_BGRA8888    #x16862004)
(define SDL_PIXELFORMAT_ARGB2101010 #x16372004)
(define SDL_PIXELFORMAT_RGBA32      #x16762004)
(define SDL_PIXELFORMAT_ARGB32      #x16862004)
(define SDL_PIXELFORMAT_BGRA32      #x16362004)
(define SDL_PIXELFORMAT_ABGR32      #x16462004)
(define SDL_PIXELFORMAT_YV12        #x32315659)
(define SDL_PIXELFORMAT_IYUV        #x56555949)
(define SDL_PIXELFORMAT_YUY2        #x32595559)
(define SDL_PIXELFORMAT_UYVY        #x59565955)
(define SDL_PIXELFORMAT_YVYU        #x55595659)
(define SDL_PIXELFORMAT_NV12        #x3231564E)
(define SDL_PIXELFORMAT_NV21        #x3132564E)

(define SDL_RENDERER_SOFTWARE      #x00000001)
(define SDL_RENDERER_ACCELERATED   #x00000002)
(define SDL_RENDERER_PRESENTVSYNC  #x00000004)
(define SDL_RENDERER_TARGETTEXTURE #x00000008)

(define SDL_TEXTUREACCESS_STATIC    0)
(define SDL_TEXTUREACCESS_STREAMING 1)
(define SDL_TEXTUREACCESS_TARGET    2)

(define SDL_FLIP_NONE       #x00000000)
(define SDL_FLIP_HORIZONTAL #x00000001)
(define SDL_FLIP_VERTICAL   #x00000002)

(define SDL_BLENDMODE_NONE    #x00000000)
(define SDL_BLENDMODE_BLEND   #x00000001)
(define SDL_BLENDMODE_ADD     #x00000002)
(define SDL_BLENDMODE_MOD     #x00000004)
(define SDL_BLENDMODE_INVALID #x7FFFFFFF)

(define SDL_BLENDOPERATION_ADD          #x1)
(define SDL_BLENDOPERATION_SUBTRACT     #x2)
(define SDL_BLENDOPERATION_REV_SUBTRACT #x3)
(define SDL_BLENDOPERATION_MINIMUM      #x4)
(define SDL_BLENDOPERATION_MAXIMUM      #x5)

(define SDL_BLENDFACTOR_ZERO                #x1)
(define SDL_BLENDFACTOR_ONE                 #x2)
(define SDL_BLENDFACTOR_SRC_COLOR           #x3)
(define SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR #x4)
(define SDL_BLENDFACTOR_SRC_ALPHA           #x5)
(define SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA #x6)
(define SDL_BLENDFACTOR_DST_COLOR           #x7)
(define SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR #x8)
(define SDL_BLENDFACTOR_DST_ALPHA           #x9)
(define SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA #xA)

;;; parse出来的结果,不一定都被引用,更不一定都被export,一些使用了未定义的类型的,chez-sdl和thunder都没定义...不知道parse-json是怎么过滤的  2023年2月26日19:12:39

(define-sdl-func string SDL_GetPlatform () "SDL_GetPlatform")
(define-sdl-func void* SDL_malloc ((size size_t)) "SDL_malloc")
(define-sdl-func void* SDL_calloc ((nmemb size_t) (size size_t)) "SDL_calloc")
(define-sdl-func void* SDL_realloc ((mem void*) (size size_t)) "SDL_realloc")
(define-sdl-func void SDL_free ((mem void*)) "SDL_free")
;;; 下面这个遇到了问题,chez-sdl和thunder都没定义这个,两者都没有实现 SDL_realloc_func 这个类型
(define-sdl-func void SDL_GetMemoryFunctions ((malloc_func (* SDL_malloc_func)) (calloc_func (* SDL_calloc_func)) (realloc_func (* SDL_realloc_func)) (free_func (* SDL_free_func))) "SDL_GetMemoryFunctions")
				
(define-sdl-func int SDL_SetMemoryFunctions ((malloc_func SDL_malloc_func) (calloc_func SDL_calloc_func) (realloc_func SDL_realloc_func) (free_func SDL_free_func)) "SDL_SetMemoryFunctions")
(define-sdl-func int SDL_GetNumAllocations () "SDL_GetNumAllocations")
(define-sdl-func string SDL_getenv ((name string)) "SDL_getenv")
(define-sdl-func int SDL_setenv ((name string) (value string) (overwrite int)) "SDL_setenv")
(define-sdl-func void SDL_qsort ((base void*) (nmemb size_t) (size size_t) (compare void*)) "SDL_qsort")
(define-sdl-func int SDL_abs ((x int)) "SDL_abs")
(define-sdl-func int SDL_isdigit ((x int)) "SDL_isdigit")
(define-sdl-func int SDL_isspace ((x int)) "SDL_isspace")
(define-sdl-func int SDL_toupper ((x int)) "SDL_toupper")
(define-sdl-func int SDL_tolower ((x int)) "SDL_tolower")
(define-sdl-func void* SDL_memset ((dst void*) (c int) (len size_t)) "SDL_memset")
(define-sdl-func void SDL_memset4 ((dst void*) (val Uint32) (dwords size_t)) "SDL_memset4")
(define-sdl-func void* SDL_memcpy ((dst void*) (src void*) (len size_t)) "SDL_memcpy")
(define-sdl-func void* SDL_memmove ((dst void*) (src void*) (len size_t)) "SDL_memmove")
(define-sdl-func int SDL_memcmp ((s1 void*) (s2 void*) (len size_t)) "SDL_memcmp")
(define-sdl-func size_t SDL_wcslen ((wstr (* wchar_t))) "SDL_wcslen")
(define-sdl-func size_t SDL_wcslcpy ((dst (* wchar_t)) (src (* wchar_t)) (maxlen size_t)) "SDL_wcslcpy")
(define-sdl-func size_t SDL_wcslcat ((dst (* wchar_t)) (src (* wchar_t)) (maxlen size_t)) "SDL_wcslcat")
(define-sdl-func int SDL_wcscmp ((str1 (* wchar_t)) (str2 (* wchar_t))) "SDL_wcscmp")
(define-sdl-func size_t SDL_strlen ((str string)) "SDL_strlen")
(define-sdl-func size_t SDL_strlcpy ((dst string) (src string) (maxlen size_t)) "SDL_strlcpy")
(define-sdl-func size_t SDL_utf8strlcpy ((dst string) (src string) (dst_bytes size_t)) "SDL_utf8strlcpy")
(define-sdl-func size_t SDL_strlcat ((dst string) (src string) (maxlen size_t)) "SDL_strlcat")
(define-sdl-func string SDL_strdup ((str string)) "SDL_strdup")
(define-sdl-func string SDL_strrev ((str string)) "SDL_strrev")
(define-sdl-func string SDL_strupr ((str string)) "SDL_strupr")
(define-sdl-func string SDL_strlwr ((str string)) "SDL_strlwr")
(define-sdl-func string SDL_strchr ((str string) (c int)) "SDL_strchr")
(define-sdl-func string SDL_strrchr ((str string) (c int)) "SDL_strrchr")
(define-sdl-func string SDL_strstr ((haystack string) (needle string)) "SDL_strstr")
(define-sdl-func size_t SDL_utf8strlen ((str string)) "SDL_utf8strlen")
(define-sdl-func string SDL_itoa ((value int) (str string) (radix int)) "SDL_itoa")
(define-sdl-func string SDL_uitoa ((value unsigned-int) (str string) (radix int)) "SDL_uitoa")
(define-sdl-func string SDL_ltoa ((value long) (str string) (radix int)) "SDL_ltoa")
(define-sdl-func string SDL_ultoa ((value unsigned-long) (str string) (radix int)) "SDL_ultoa")
(define-sdl-func string SDL_lltoa ((value Sint64) (str string) (radix int)) "SDL_lltoa")
(define-sdl-func string SDL_ulltoa ((value Uint64) (str string) (radix int)) "SDL_ulltoa")
(define-sdl-func int SDL_atoi ((str string)) "SDL_atoi")
(define-sdl-func double SDL_atof ((str string)) "SDL_atof")
(define-sdl-func long SDL_strtol ((str string) (endp void*) (base int)) "SDL_strtol")
(define-sdl-func unsigned-long SDL_strtoul ((str string) (endp void*) (base int)) "SDL_strtoul")
(define-sdl-func Sint64 SDL_strtoll ((str string) (endp void*) (base int)) "SDL_strtoll")
(define-sdl-func Uint64 SDL_strtoull ((str string) (endp void*) (base int)) "SDL_strtoull")
(define-sdl-func double SDL_strtod ((str string) (endp void*)) "SDL_strtod")
(define-sdl-func int SDL_strcmp ((str1 string) (str2 string)) "SDL_strcmp")
(define-sdl-func int SDL_strncmp ((str1 string) (str2 string) (maxlen size_t)) "SDL_strncmp")
(define-sdl-func int SDL_strcasecmp ((str1 string) (str2 string)) "SDL_strcasecmp")
(define-sdl-func int SDL_strncasecmp ((str1 string) (str2 string) (len size_t)) "SDL_strncasecmp")
(define-sdl-func int SDL_sscanf ((text string) (fmt string)) "SDL_sscanf")
(define-sdl-func int SDL_vsscanf ((text string) (fmt string) (ap va_list)) "SDL_vsscanf")
(define-sdl-func int SDL_snprintf ((text string) (maxlen size_t) (fmt string)) "SDL_snprintf")
(define-sdl-func int SDL_vsnprintf ((text string) (maxlen size_t) (fmt string) (ap va_list)) "SDL_vsnprintf")
(define-sdl-func double SDL_acos ((x double)) "SDL_acos")
(define-sdl-func double SDL_asin ((x double)) "SDL_asin")
(define-sdl-func double SDL_atan ((x double)) "SDL_atan")
(define-sdl-func double SDL_atan2 ((x double) (y double)) "SDL_atan2")
(define-sdl-func double SDL_ceil ((x double)) "SDL_ceil")
(define-sdl-func double SDL_copysign ((x double) (y double)) "SDL_copysign")
(define-sdl-func double SDL_cos ((x double)) "SDL_cos")
(define-sdl-func float SDL_cosf ((x float)) "SDL_cosf")
(define-sdl-func double SDL_fabs ((x double)) "SDL_fabs")
(define-sdl-func double SDL_floor ((x double)) "SDL_floor")
(define-sdl-func double SDL_log ((x double)) "SDL_log")
(define-sdl-func double SDL_pow ((x double) (y double)) "SDL_pow")
(define-sdl-func double SDL_scalbn ((x double) (n int)) "SDL_scalbn")
(define-sdl-func double SDL_sin ((x double)) "SDL_sin")
(define-sdl-func float SDL_sinf ((x float)) "SDL_sinf")
(define-sdl-func double SDL_sqrt ((x double)) "SDL_sqrt")
(define-sdl-func float SDL_sqrtf ((x float)) "SDL_sqrtf")
(define-sdl-func double SDL_tan ((x double)) "SDL_tan")
(define-sdl-func float SDL_tanf ((x float)) "SDL_tanf")
(define-sdl-func SDL_iconv_t SDL_iconv_open ((tocode string) (fromcode string)) "SDL_iconv_open")
(define-sdl-func int SDL_iconv_close ((cd SDL_iconv_t)) "SDL_iconv_close")
(define-sdl-func size_t SDL_iconv ((cd SDL_iconv_t) (inbuf void*) (inbytesleft (* size_t)) (outbuf void*) (outbytesleft (* size_t))) "SDL_iconv")
(define-sdl-func string SDL_iconv_string ((tocode string) (fromcode string) (inbuf string) (inbytesleft size_t)) "SDL_iconv_string")
(define-sdl-func void* SDL_memcpy4 ((dst void*) (src void*) (dwords size_t)) "SDL_memcpy4")
(define-sdl-func int SDL_main ((argc int) (argv void*)) "SDL_main")
(define-sdl-func void SDL_SetMainReady () "SDL_SetMainReady")
(define-sdl-func SDL_AssertState SDL_ReportAssertion ((arg-0 (* SDL_AssertData)) (arg-1 string) (arg-2 string) (arg-3 int)) "SDL_ReportAssertion")
(define-sdl-func void SDL_SetAssertionHandler ((handler SDL_AssertionHandler) (userdata void*)) "SDL_SetAssertionHandler")
(define-sdl-func SDL_AssertionHandler SDL_GetDefaultAssertionHandler () "SDL_GetDefaultAssertionHandler")
(define-sdl-func SDL_AssertionHandler SDL_GetAssertionHandler ((puserdata (* void*))) "SDL_GetAssertionHandler")
(define-sdl-func (* SDL_AssertData) SDL_GetAssertionReport () "SDL_GetAssertionReport")
(define-sdl-func void SDL_ResetAssertionReport () "SDL_ResetAssertionReport")
(define-sdl-func SDL_bool SDL_AtomicTryLock ((lock (* SDL_SpinLock))) "SDL_AtomicTryLock")
(define-sdl-func void SDL_AtomicLock ((lock (* SDL_SpinLock))) "SDL_AtomicLock")
(define-sdl-func void SDL_AtomicUnlock ((lock (* SDL_SpinLock))) "SDL_AtomicUnlock")
(define-sdl-func void SDL_MemoryBarrierReleaseFunction () "SDL_MemoryBarrierReleaseFunction")
(define-sdl-func void SDL_MemoryBarrierAcquireFunction () "SDL_MemoryBarrierAcquireFunction")
(define-sdl-func SDL_bool SDL_AtomicCAS ((a (* SDL_atomic_t)) (oldval int) (newval int)) "SDL_AtomicCAS")
(define-sdl-func int SDL_AtomicSet ((a (* SDL_atomic_t)) (v int)) "SDL_AtomicSet")
(define-sdl-func int SDL_AtomicGet ((a (* SDL_atomic_t))) "SDL_AtomicGet")
(define-sdl-func int SDL_AtomicAdd ((a (* SDL_atomic_t)) (v int)) "SDL_AtomicAdd")
(define-sdl-func SDL_bool SDL_AtomicCASPtr ((a (* void*)) (oldval void*) (newval void*)) "SDL_AtomicCASPtr")
(define-sdl-func void* SDL_AtomicSetPtr ((a (* void*)) (v void*)) "SDL_AtomicSetPtr")
(define-sdl-func void* SDL_AtomicGetPtr ((a (* void*))) "SDL_AtomicGetPtr")
(define-sdl-func int SDL_SetError ((fmt string)) "SDL_SetError")
(define-sdl-func string SDL_GetError () "SDL_GetError")
(define-sdl-func void SDL_ClearError () "SDL_ClearError")
(define-sdl-func int SDL_Error ((code SDL_errorcode)) "SDL_Error")
(define-sdl-func Uint16 SDL_Swap16 ((x Uint16)) "SDL_Swap16")
(define-sdl-func Uint32 SDL_Swap32 ((x Uint32)) "SDL_Swap32")
(define-sdl-func Uint64 SDL_Swap64 ((x Uint64)) "SDL_Swap64")
(define-sdl-func float SDL_SwapFloat ((x float)) "SDL_SwapFloat")
(define-sdl-func (* SDL_mutex) SDL_CreateMutex () "SDL_CreateMutex")
(define-sdl-func int SDL_LockMutex ((mutex (* SDL_mutex))) "SDL_LockMutex")
(define-sdl-func int SDL_TryLockMutex ((mutex (* SDL_mutex))) "SDL_TryLockMutex")
(define-sdl-func int SDL_UnlockMutex ((mutex (* SDL_mutex))) "SDL_UnlockMutex")
(define-sdl-func void SDL_DestroyMutex ((mutex (* SDL_mutex))) "SDL_DestroyMutex")
(define-sdl-func (* SDL_sem) SDL_CreateSemaphore ((initial_value Uint32)) "SDL_CreateSemaphore")
(define-sdl-func void SDL_DestroySemaphore ((sem (* SDL_sem))) "SDL_DestroySemaphore")
(define-sdl-func int SDL_SemWait ((sem (* SDL_sem))) "SDL_SemWait")
(define-sdl-func int SDL_SemTryWait ((sem (* SDL_sem))) "SDL_SemTryWait")
(define-sdl-func int SDL_SemWaitTimeout ((sem (* SDL_sem)) (ms Uint32)) "SDL_SemWaitTimeout")
(define-sdl-func int SDL_SemPost ((sem (* SDL_sem))) "SDL_SemPost")
(define-sdl-func Uint32 SDL_SemValue ((sem (* SDL_sem))) "SDL_SemValue")
(define-sdl-func (* SDL_cond) SDL_CreateCond () "SDL_CreateCond")
(define-sdl-func void SDL_DestroyCond ((cond (* SDL_cond))) "SDL_DestroyCond")
(define-sdl-func int SDL_CondSignal ((cond (* SDL_cond))) "SDL_CondSignal")
(define-sdl-func int SDL_CondBroadcast ((cond (* SDL_cond))) "SDL_CondBroadcast")
(define-sdl-func int SDL_CondWait ((cond (* SDL_cond)) (mutex (* SDL_mutex))) "SDL_CondWait")
(define-sdl-func int SDL_CondWaitTimeout ((cond (* SDL_cond)) (mutex (* SDL_mutex)) (ms Uint32)) "SDL_CondWaitTimeout")
(define-sdl-func (* SDL_Thread) SDL_CreateThread ((fn SDL_ThreadFunction) (name string) (data void*)) "SDL_CreateThread")
(define-sdl-func string SDL_GetThreadName ((thread (* SDL_Thread))) "SDL_GetThreadName")
(define-sdl-func SDL_threadID SDL_ThreadID () "SDL_ThreadID")
(define-sdl-func SDL_threadID SDL_GetThreadID ((thread (* SDL_Thread))) "SDL_GetThreadID")
(define-sdl-func int SDL_SetThreadPriority ((priority SDL_ThreadPriority)) "SDL_SetThreadPriority")
(define-sdl-func void SDL_WaitThread ((thread (* SDL_Thread)) (status (* int))) "SDL_WaitThread")
(define-sdl-func void SDL_DetachThread ((thread (* SDL_Thread))) "SDL_DetachThread")
(define-sdl-func SDL_TLSID SDL_TLSCreate () "SDL_TLSCreate")
(define-sdl-func void* SDL_TLSGet ((id SDL_TLSID)) "SDL_TLSGet")
(define-sdl-func int SDL_TLSSet ((id SDL_TLSID) (value void*) (destructor void*)) "SDL_TLSSet")
(define-sdl-func (* SDL_RWops) SDL_RWFromFile ((file string) (mode string)) "SDL_RWFromFile")
(define-sdl-func (* SDL_RWops) SDL_RWFromFP ((fp (* FILE)) (autoclose SDL_bool)) "SDL_RWFromFP")
(define-sdl-func (* SDL_RWops) SDL_RWFromMem ((mem void*) (size int)) "SDL_RWFromMem")
(define-sdl-func (* SDL_RWops) SDL_RWFromConstMem ((mem void*) (size int)) "SDL_RWFromConstMem")
(define-sdl-func (* SDL_RWops) SDL_AllocRW () "SDL_AllocRW")
(define-sdl-func void SDL_FreeRW ((area (* SDL_RWops))) "SDL_FreeRW")
(define-sdl-func void* SDL_LoadFile_RW ((src (* SDL_RWops)) (datasize (* size_t)) (freesrc int)) "SDL_LoadFile_RW")
(define-sdl-func Uint8 SDL_ReadU8 ((src (* SDL_RWops))) "SDL_ReadU8")
(define-sdl-func Uint16 SDL_ReadLE16 ((src (* SDL_RWops))) "SDL_ReadLE16")
(define-sdl-func Uint16 SDL_ReadBE16 ((src (* SDL_RWops))) "SDL_ReadBE16")
(define-sdl-func Uint32 SDL_ReadLE32 ((src (* SDL_RWops))) "SDL_ReadLE32")
(define-sdl-func Uint32 SDL_ReadBE32 ((src (* SDL_RWops))) "SDL_ReadBE32")
(define-sdl-func Uint64 SDL_ReadLE64 ((src (* SDL_RWops))) "SDL_ReadLE64")
(define-sdl-func Uint64 SDL_ReadBE64 ((src (* SDL_RWops))) "SDL_ReadBE64")
(define-sdl-func size_t SDL_WriteU8 ((dst (* SDL_RWops)) (value Uint8)) "SDL_WriteU8")
(define-sdl-func size_t SDL_WriteLE16 ((dst (* SDL_RWops)) (value Uint16)) "SDL_WriteLE16")
(define-sdl-func size_t SDL_WriteBE16 ((dst (* SDL_RWops)) (value Uint16)) "SDL_WriteBE16")
(define-sdl-func size_t SDL_WriteLE32 ((dst (* SDL_RWops)) (value Uint32)) "SDL_WriteLE32")
(define-sdl-func size_t SDL_WriteBE32 ((dst (* SDL_RWops)) (value Uint32)) "SDL_WriteBE32")
(define-sdl-func size_t SDL_WriteLE64 ((dst (* SDL_RWops)) (value Uint64)) "SDL_WriteLE64")
(define-sdl-func size_t SDL_WriteBE64 ((dst (* SDL_RWops)) (value Uint64)) "SDL_WriteBE64")
(define-sdl-func int SDL_GetNumAudioDrivers () "SDL_GetNumAudioDrivers")
(define-sdl-func string SDL_GetAudioDriver ((index int)) "SDL_GetAudioDriver")
(define-sdl-func int SDL_AudioInit ((driver_name string)) "SDL_AudioInit")
(define-sdl-func void SDL_AudioQuit () "SDL_AudioQuit")
(define-sdl-func string SDL_GetCurrentAudioDriver () "SDL_GetCurrentAudioDriver")
(define-sdl-func int SDL_OpenAudio ((desired (* SDL_AudioSpec)) (obtained (* SDL_AudioSpec))) "SDL_OpenAudio")
(define-sdl-func int SDL_GetNumAudioDevices ((iscapture int)) "SDL_GetNumAudioDevices")
(define-sdl-func string SDL_GetAudioDeviceName ((index int) (iscapture int)) "SDL_GetAudioDeviceName")
(define-sdl-func SDL_AudioDeviceID SDL_OpenAudioDevice ((device string) (iscapture int) (desired (* SDL_AudioSpec)) (obtained (* SDL_AudioSpec)) (allowed_changes int)) "SDL_OpenAudioDevice")
(define-sdl-func SDL_AudioStatus SDL_GetAudioStatus () "SDL_GetAudioStatus")
(define-sdl-func SDL_AudioStatus SDL_GetAudioDeviceStatus ((dev SDL_AudioDeviceID)) "SDL_GetAudioDeviceStatus")
(define-sdl-func void SDL_PauseAudio ((pause_on int)) "SDL_PauseAudio")
(define-sdl-func void SDL_PauseAudioDevice ((dev SDL_AudioDeviceID) (pause_on int)) "SDL_PauseAudioDevice")
(define-sdl-func (* SDL_AudioSpec) SDL_LoadWAV_RW ((src (* SDL_RWops)) (freesrc int) (spec (* SDL_AudioSpec)) (audio_buf (* Uint8)) (audio_len (* Uint32))) "SDL_LoadWAV_RW")
(define-sdl-func void SDL_FreeWAV ((audio_buf (* Uint8))) "SDL_FreeWAV")
(define-sdl-func int SDL_BuildAudioCVT ((cvt (* SDL_AudioCVT)) (src_format SDL_AudioFormat) (src_channels Uint8) (src_rate int) (dst_format SDL_AudioFormat) (dst_channels Uint8) (dst_rate int)) "SDL_BuildAudioCVT")
(define-sdl-func int SDL_ConvertAudio ((cvt (* SDL_AudioCVT))) "SDL_ConvertAudio")
(define-sdl-func (* SDL_AudioStream) SDL_NewAudioStream ((src_format SDL_AudioFormat) (src_channels Uint8) (src_rate int) (dst_format SDL_AudioFormat) (dst_channels Uint8) (dst_rate int)) "SDL_NewAudioStream")
(define-sdl-func int SDL_AudioStreamPut ((stream (* SDL_AudioStream)) (buf void*) (len int)) "SDL_AudioStreamPut")
(define-sdl-func int SDL_AudioStreamGet ((stream (* SDL_AudioStream)) (buf void*) (len int)) "SDL_AudioStreamGet")
(define-sdl-func int SDL_AudioStreamAvailable ((stream (* SDL_AudioStream))) "SDL_AudioStreamAvailable")
(define-sdl-func int SDL_AudioStreamFlush ((stream (* SDL_AudioStream))) "SDL_AudioStreamFlush")
(define-sdl-func void SDL_AudioStreamClear ((stream (* SDL_AudioStream))) "SDL_AudioStreamClear")
(define-sdl-func void SDL_FreeAudioStream ((stream (* SDL_AudioStream))) "SDL_FreeAudioStream")
(define-sdl-func void SDL_MixAudio ((dst (* Uint8)) (src (* Uint8)) (len Uint32) (volume int)) "SDL_MixAudio")
(define-sdl-func void SDL_MixAudioFormat ((dst (* Uint8)) (src (* Uint8)) (format SDL_AudioFormat) (len Uint32) (volume int)) "SDL_MixAudioFormat")
(define-sdl-func int SDL_QueueAudio ((dev SDL_AudioDeviceID) (data void*) (len Uint32)) "SDL_QueueAudio")
(define-sdl-func Uint32 SDL_DequeueAudio ((dev SDL_AudioDeviceID) (data void*) (len Uint32)) "SDL_DequeueAudio")
(define-sdl-func Uint32 SDL_GetQueuedAudioSize ((dev SDL_AudioDeviceID)) "SDL_GetQueuedAudioSize")
(define-sdl-func void SDL_ClearQueuedAudio ((dev SDL_AudioDeviceID)) "SDL_ClearQueuedAudio")
(define-sdl-func void SDL_LockAudio () "SDL_LockAudio")
(define-sdl-func void SDL_LockAudioDevice ((dev SDL_AudioDeviceID)) "SDL_LockAudioDevice")
(define-sdl-func void SDL_UnlockAudio () "SDL_UnlockAudio")
(define-sdl-func void SDL_UnlockAudioDevice ((dev SDL_AudioDeviceID)) "SDL_UnlockAudioDevice")
(define-sdl-func void SDL_CloseAudio () "SDL_CloseAudio")
(define-sdl-func void SDL_CloseAudioDevice ((dev SDL_AudioDeviceID)) "SDL_CloseAudioDevice")
(define-sdl-func int SDL_SetClipboardText ((text string)) "SDL_SetClipboardText")
(define-sdl-func string SDL_GetClipboardText () "SDL_GetClipboardText")
(define-sdl-func SDL_bool SDL_HasClipboardText () "SDL_HasClipboardText")
(define-sdl-func int SDL_GetCPUCount () "SDL_GetCPUCount")
(define-sdl-func int SDL_GetCPUCacheLineSize () "SDL_GetCPUCacheLineSize")
(define-sdl-func SDL_bool SDL_HasRDTSC () "SDL_HasRDTSC")
(define-sdl-func SDL_bool SDL_HasAltiVec () "SDL_HasAltiVec")
(define-sdl-func SDL_bool SDL_HasMMX () "SDL_HasMMX")
(define-sdl-func SDL_bool SDL_Has3DNow () "SDL_Has3DNow")
(define-sdl-func SDL_bool SDL_HasSSE () "SDL_HasSSE")
(define-sdl-func SDL_bool SDL_HasSSE2 () "SDL_HasSSE2")
(define-sdl-func SDL_bool SDL_HasSSE3 () "SDL_HasSSE3")
(define-sdl-func SDL_bool SDL_HasSSE41 () "SDL_HasSSE41")
(define-sdl-func SDL_bool SDL_HasSSE42 () "SDL_HasSSE42")
(define-sdl-func SDL_bool SDL_HasAVX () "SDL_HasAVX")
(define-sdl-func SDL_bool SDL_HasAVX2 () "SDL_HasAVX2")
(define-sdl-func SDL_bool SDL_HasNEON () "SDL_HasNEON")
(define-sdl-func int SDL_GetSystemRAM () "SDL_GetSystemRAM")
(define-sdl-func string SDL_GetPixelFormatName ((format Uint32)) "SDL_GetPixelFormatName")
(define-sdl-func SDL_bool SDL_PixelFormatEnumToMasks ((format Uint32) (bpp (* int)) (Rmask (* Uint32)) (Gmask (* Uint32)) (Bmask (* Uint32)) (Amask (* Uint32))) "SDL_PixelFormatEnumToMasks")
(define-sdl-func Uint32 SDL_MasksToPixelFormatEnum ((bpp int) (Rmask Uint32) (Gmask Uint32) (Bmask Uint32) (Amask Uint32)) "SDL_MasksToPixelFormatEnum")
(define-sdl-func (* SDL_PixelFormat) SDL_AllocFormat ((pixel_format Uint32)) "SDL_AllocFormat")
(define-sdl-func void SDL_FreeFormat ((format (* SDL_PixelFormat))) "SDL_FreeFormat")
(define-sdl-func (* SDL_Palette) SDL_AllocPalette ((ncolors int)) "SDL_AllocPalette")
(define-sdl-func int SDL_SetPixelFormatPalette ((format (* SDL_PixelFormat)) (palette (* SDL_Palette))) "SDL_SetPixelFormatPalette")
(define-sdl-func int SDL_SetPaletteColors ((palette (* SDL_Palette)) (colors (* SDL_Color)) (firstcolor int) (ncolors int)) "SDL_SetPaletteColors")
(define-sdl-func void SDL_FreePalette ((palette (* SDL_Palette))) "SDL_FreePalette")
(define-sdl-func Uint32 SDL_MapRGB ((format (* SDL_PixelFormat)) (r Uint8) (g Uint8) (b Uint8)) "SDL_MapRGB")
(define-sdl-func Uint32 SDL_MapRGBA ((format (* SDL_PixelFormat)) (r Uint8) (g Uint8) (b Uint8) (a Uint8)) "SDL_MapRGBA")
(define-sdl-func void SDL_GetRGB ((pixel Uint32) (format (* SDL_PixelFormat)) (r (* Uint8)) (g (* Uint8)) (b (* Uint8))) "SDL_GetRGB")
(define-sdl-func void SDL_GetRGBA ((pixel Uint32) (format (* SDL_PixelFormat)) (r (* Uint8)) (g (* Uint8)) (b (* Uint8)) (a (* Uint8))) "SDL_GetRGBA")
(define-sdl-func void SDL_CalculateGammaRamp ((gamma float) (ramp (* Uint16))) "SDL_CalculateGammaRamp")
(define-sdl-func SDL_bool SDL_PointInRect ((p (* SDL_Point)) (r (* SDL_Rect))) "SDL_PointInRect")
(define-sdl-func SDL_bool SDL_RectEmpty ((r (* SDL_Rect))) "SDL_RectEmpty")
(define-sdl-func SDL_bool SDL_RectEquals ((a (* SDL_Rect)) (b (* SDL_Rect))) "SDL_RectEquals")
(define-sdl-func SDL_bool SDL_HasIntersection ((A (* SDL_Rect)) (B (* SDL_Rect))) "SDL_HasIntersection")
(define-sdl-func SDL_bool SDL_IntersectRect ((A (* SDL_Rect)) (B (* SDL_Rect)) (result (* SDL_Rect))) "SDL_IntersectRect")
(define-sdl-func void SDL_UnionRect ((A (* SDL_Rect)) (B (* SDL_Rect)) (result (* SDL_Rect))) "SDL_UnionRect")
(define-sdl-func SDL_bool SDL_EnclosePoints ((points (* SDL_Point)) (count int) (clip (* SDL_Rect)) (result (* SDL_Rect))) "SDL_EnclosePoints")
(define-sdl-func SDL_bool SDL_IntersectRectAndLine ((rect (* SDL_Rect)) (X1 (* int)) (Y1 (* int)) (X2 (* int)) (Y2 (* int))) "SDL_IntersectRectAndLine")
(define-sdl-func SDL_BlendMode SDL_ComposeCustomBlendMode ((srcColorFactor SDL_BlendFactor) (dstColorFactor SDL_BlendFactor) (colorOperation SDL_BlendOperation) (srcAlphaFactor SDL_BlendFactor) (dstAlphaFactor SDL_BlendFactor) (alphaOperation SDL_BlendOperation)) "SDL_ComposeCustomBlendMode")
(define-sdl-func (* SDL_Surface) SDL_CreateRGBSurface ((flags Uint32) (width int) (height int) (depth int) (Rmask Uint32) (Gmask Uint32) (Bmask Uint32) (Amask Uint32)) "SDL_CreateRGBSurface")
(define-sdl-func (* SDL_Surface) SDL_CreateRGBSurfaceWithFormat ((flags Uint32) (width int) (height int) (depth int) (format Uint32)) "SDL_CreateRGBSurfaceWithFormat")
(define-sdl-func (* SDL_Surface) SDL_CreateRGBSurfaceFrom ((pixels void*) (width int) (height int) (depth int) (pitch int) (Rmask Uint32) (Gmask Uint32) (Bmask Uint32) (Amask Uint32)) "SDL_CreateRGBSurfaceFrom")
(define-sdl-func (* SDL_Surface) SDL_CreateRGBSurfaceWithFormatFrom ((pixels void*) (width int) (height int) (depth int) (pitch int) (format Uint32)) "SDL_CreateRGBSurfaceWithFormatFrom")
(define-sdl-func void SDL_FreeSurface ((surface (* SDL_Surface))) "SDL_FreeSurface")
(define-sdl-func int SDL_SetSurfacePalette ((surface (* SDL_Surface)) (palette (* SDL_Palette))) "SDL_SetSurfacePalette")
(define-sdl-func int SDL_LockSurface ((surface (* SDL_Surface))) "SDL_LockSurface")
(define-sdl-func void SDL_UnlockSurface ((surface (* SDL_Surface))) "SDL_UnlockSurface")
(define-sdl-func (* SDL_Surface) SDL_LoadBMP_RW ((src (* SDL_RWops)) (freesrc int)) "SDL_LoadBMP_RW")
(define-sdl-func int SDL_SaveBMP_RW ((surface (* SDL_Surface)) (dst (* SDL_RWops)) (freedst int)) "SDL_SaveBMP_RW")
(define-sdl-func int SDL_SetSurfaceRLE ((surface (* SDL_Surface)) (flag int)) "SDL_SetSurfaceRLE")
(define-sdl-func int SDL_SetColorKey ((surface (* SDL_Surface)) (flag int) (key Uint32)) "SDL_SetColorKey")
(define-sdl-func int SDL_GetColorKey ((surface (* SDL_Surface)) (key (* Uint32))) "SDL_GetColorKey")
(define-sdl-func int SDL_SetSurfaceColorMod ((surface (* SDL_Surface)) (r Uint8) (g Uint8) (b Uint8)) "SDL_SetSurfaceColorMod")
(define-sdl-func int SDL_GetSurfaceColorMod ((surface (* SDL_Surface)) (r (* Uint8)) (g (* Uint8)) (b (* Uint8))) "SDL_GetSurfaceColorMod")
(define-sdl-func int SDL_SetSurfaceAlphaMod ((surface (* SDL_Surface)) (alpha Uint8)) "SDL_SetSurfaceAlphaMod")
(define-sdl-func int SDL_GetSurfaceAlphaMod ((surface (* SDL_Surface)) (alpha (* Uint8))) "SDL_GetSurfaceAlphaMod")
(define-sdl-func int SDL_SetSurfaceBlendMode ((surface (* SDL_Surface)) (blendMode SDL_BlendMode)) "SDL_SetSurfaceBlendMode")
(define-sdl-func int SDL_GetSurfaceBlendMode ((surface (* SDL_Surface)) (blendMode (* SDL_BlendMode))) "SDL_GetSurfaceBlendMode")
(define-sdl-func SDL_bool SDL_SetClipRect ((surface (* SDL_Surface)) (rect (* SDL_Rect))) "SDL_SetClipRect")
(define-sdl-func void SDL_GetClipRect ((surface (* SDL_Surface)) (rect (* SDL_Rect))) "SDL_GetClipRect")
(define-sdl-func (* SDL_Surface) SDL_DuplicateSurface ((surface (* SDL_Surface))) "SDL_DuplicateSurface")
(define-sdl-func (* SDL_Surface) SDL_ConvertSurface ((src (* SDL_Surface)) (fmt (* SDL_PixelFormat)) (flags Uint32)) "SDL_ConvertSurface")
(define-sdl-func (* SDL_Surface) SDL_ConvertSurfaceFormat ((src (* SDL_Surface)) (pixel_format Uint32) (flags Uint32)) "SDL_ConvertSurfaceFormat")
(define-sdl-func int SDL_ConvertPixels ((width int) (height int) (src_format Uint32) (src void*) (src_pitch int) (dst_format Uint32) (dst void*) (dst_pitch int)) "SDL_ConvertPixels")
(define-sdl-func int SDL_FillRect ((dst (* SDL_Surface)) (rect (* SDL_Rect)) (color Uint32)) "SDL_FillRect")
(define-sdl-func int SDL_FillRects ((dst (* SDL_Surface)) (rects (* SDL_Rect)) (count int) (color Uint32)) "SDL_FillRects")
(define-sdl-func int SDL_UpperBlit ((src (* SDL_Surface)) (srcrect (* SDL_Rect)) (dst (* SDL_Surface)) (dstrect (* SDL_Rect))) "SDL_UpperBlit")
(define-sdl-func int SDL_LowerBlit ((src (* SDL_Surface)) (srcrect (* SDL_Rect)) (dst (* SDL_Surface)) (dstrect (* SDL_Rect))) "SDL_LowerBlit")
(define-sdl-func int SDL_SoftStretch ((src (* SDL_Surface)) (srcrect (* SDL_Rect)) (dst (* SDL_Surface)) (dstrect (* SDL_Rect))) "SDL_SoftStretch")
(define-sdl-func int SDL_UpperBlitScaled ((src (* SDL_Surface)) (srcrect (* SDL_Rect)) (dst (* SDL_Surface)) (dstrect (* SDL_Rect))) "SDL_UpperBlitScaled")
(define-sdl-func int SDL_LowerBlitScaled ((src (* SDL_Surface)) (srcrect (* SDL_Rect)) (dst (* SDL_Surface)) (dstrect (* SDL_Rect))) "SDL_LowerBlitScaled")
(define-sdl-func int SDL_GetNumVideoDrivers () "SDL_GetNumVideoDrivers")
(define-sdl-func string SDL_GetVideoDriver ((index int)) "SDL_GetVideoDriver")
(define-sdl-func int SDL_VideoInit ((driver_name string)) "SDL_VideoInit")
(define-sdl-func void SDL_VideoQuit () "SDL_VideoQuit")
(define-sdl-func string SDL_GetCurrentVideoDriver () "SDL_GetCurrentVideoDriver")
(define-sdl-func int SDL_GetNumVideoDisplays () "SDL_GetNumVideoDisplays")
(define-sdl-func string SDL_GetDisplayName ((displayIndex int)) "SDL_GetDisplayName")
(define-sdl-func int SDL_GetDisplayBounds ((displayIndex int) (rect (* SDL_Rect))) "SDL_GetDisplayBounds")
(define-sdl-func int SDL_GetDisplayDPI ((displayIndex int) (ddpi (* float)) (hdpi (* float)) (vdpi (* float))) "SDL_GetDisplayDPI")
(define-sdl-func int SDL_GetDisplayUsableBounds ((displayIndex int) (rect (* SDL_Rect))) "SDL_GetDisplayUsableBounds")
(define-sdl-func int SDL_GetNumDisplayModes ((displayIndex int)) "SDL_GetNumDisplayModes")
(define-sdl-func int SDL_GetDisplayMode ((displayIndex int) (modeIndex int) (mode (* SDL_DisplayMode))) "SDL_GetDisplayMode")
(define-sdl-func int SDL_GetDesktopDisplayMode ((displayIndex int) (mode (* SDL_DisplayMode))) "SDL_GetDesktopDisplayMode")
(define-sdl-func int SDL_GetCurrentDisplayMode ((displayIndex int) (mode (* SDL_DisplayMode))) "SDL_GetCurrentDisplayMode")
(define-sdl-func (* SDL_DisplayMode) SDL_GetClosestDisplayMode ((displayIndex int) (mode (* SDL_DisplayMode)) (closest (* SDL_DisplayMode))) "SDL_GetClosestDisplayMode")
(define-sdl-func int SDL_GetWindowDisplayIndex ((window (* SDL_Window))) "SDL_GetWindowDisplayIndex")
(define-sdl-func int SDL_SetWindowDisplayMode ((window (* SDL_Window)) (mode (* SDL_DisplayMode))) "SDL_SetWindowDisplayMode")
(define-sdl-func int SDL_GetWindowDisplayMode ((window (* SDL_Window)) (mode (* SDL_DisplayMode))) "SDL_GetWindowDisplayMode")
(define-sdl-func Uint32 SDL_GetWindowPixelFormat ((window (* SDL_Window))) "SDL_GetWindowPixelFormat")
(define-sdl-func (* SDL_Window) SDL_CreateWindow ((title string) (x int) (y int) (w int) (h int) (flags Uint32)) "SDL_CreateWindow")
(define-sdl-func (* SDL_Window) SDL_CreateWindowFrom ((data void*)) "SDL_CreateWindowFrom")
(define-sdl-func Uint32 SDL_GetWindowID ((window (* SDL_Window))) "SDL_GetWindowID")
(define-sdl-func (* SDL_Window) SDL_GetWindowFromID ((id Uint32)) "SDL_GetWindowFromID")
(define-sdl-func Uint32 SDL_GetWindowFlags ((window (* SDL_Window))) "SDL_GetWindowFlags")
(define-sdl-func void SDL_SetWindowTitle ((window (* SDL_Window)) (title string)) "SDL_SetWindowTitle")
(define-sdl-func string SDL_GetWindowTitle ((window (* SDL_Window))) "SDL_GetWindowTitle")
(define-sdl-func void SDL_SetWindowIcon ((window (* SDL_Window)) (icon (* SDL_Surface))) "SDL_SetWindowIcon")
(define-sdl-func void* SDL_SetWindowData ((window (* SDL_Window)) (name string) (userdata void*)) "SDL_SetWindowData")
(define-sdl-func void* SDL_GetWindowData ((window (* SDL_Window)) (name string)) "SDL_GetWindowData")
(define-sdl-func void SDL_SetWindowPosition ((window (* SDL_Window)) (x int) (y int)) "SDL_SetWindowPosition")
(define-sdl-func void SDL_GetWindowPosition ((window (* SDL_Window)) (x (* int)) (y (* int))) "SDL_GetWindowPosition")
(define-sdl-func void SDL_SetWindowSize ((window (* SDL_Window)) (w int) (h int)) "SDL_SetWindowSize")
(define-sdl-func void SDL_GetWindowSize ((window (* SDL_Window)) (w (* int)) (h (* int))) "SDL_GetWindowSize")
(define-sdl-func int SDL_GetWindowBordersSize ((window (* SDL_Window)) (top (* int)) (left (* int)) (bottom (* int)) (right (* int))) "SDL_GetWindowBordersSize")
(define-sdl-func void SDL_SetWindowMinimumSize ((window (* SDL_Window)) (min_w int) (min_h int)) "SDL_SetWindowMinimumSize")
(define-sdl-func void SDL_GetWindowMinimumSize ((window (* SDL_Window)) (w (* int)) (h (* int))) "SDL_GetWindowMinimumSize")
(define-sdl-func void SDL_SetWindowMaximumSize ((window (* SDL_Window)) (max_w int) (max_h int)) "SDL_SetWindowMaximumSize")
(define-sdl-func void SDL_GetWindowMaximumSize ((window (* SDL_Window)) (w (* int)) (h (* int))) "SDL_GetWindowMaximumSize")
(define-sdl-func void SDL_SetWindowBordered ((window (* SDL_Window)) (bordered SDL_bool)) "SDL_SetWindowBordered")
(define-sdl-func void SDL_SetWindowResizable ((window (* SDL_Window)) (resizable SDL_bool)) "SDL_SetWindowResizable")
(define-sdl-func void SDL_ShowWindow ((window (* SDL_Window))) "SDL_ShowWindow")
(define-sdl-func void SDL_HideWindow ((window (* SDL_Window))) "SDL_HideWindow")
(define-sdl-func void SDL_RaiseWindow ((window (* SDL_Window))) "SDL_RaiseWindow")
(define-sdl-func void SDL_MaximizeWindow ((window (* SDL_Window))) "SDL_MaximizeWindow")
(define-sdl-func void SDL_MinimizeWindow ((window (* SDL_Window))) "SDL_MinimizeWindow")
(define-sdl-func void SDL_RestoreWindow ((window (* SDL_Window))) "SDL_RestoreWindow")
(define-sdl-func int SDL_SetWindowFullscreen ((window (* SDL_Window)) (flags Uint32)) "SDL_SetWindowFullscreen")
(define-sdl-func (* SDL_Surface) SDL_GetWindowSurface ((window (* SDL_Window))) "SDL_GetWindowSurface")
(define-sdl-func int SDL_UpdateWindowSurface ((window (* SDL_Window))) "SDL_UpdateWindowSurface")
(define-sdl-func int SDL_UpdateWindowSurfaceRects ((window (* SDL_Window)) (rects (* SDL_Rect)) (numrects int)) "SDL_UpdateWindowSurfaceRects")
(define-sdl-func void SDL_SetWindowGrab ((window (* SDL_Window)) (grabbed SDL_bool)) "SDL_SetWindowGrab")
(define-sdl-func SDL_bool SDL_GetWindowGrab ((window (* SDL_Window))) "SDL_GetWindowGrab")
(define-sdl-func (* SDL_Window) SDL_GetGrabbedWindow () "SDL_GetGrabbedWindow")
(define-sdl-func int SDL_SetWindowBrightness ((window (* SDL_Window)) (brightness float)) "SDL_SetWindowBrightness")
(define-sdl-func float SDL_GetWindowBrightness ((window (* SDL_Window))) "SDL_GetWindowBrightness")
(define-sdl-func int SDL_SetWindowOpacity ((window (* SDL_Window)) (opacity float)) "SDL_SetWindowOpacity")
(define-sdl-func int SDL_GetWindowOpacity ((window (* SDL_Window)) (out_opacity (* float))) "SDL_GetWindowOpacity")
(define-sdl-func int SDL_SetWindowModalFor ((modal_window (* SDL_Window)) (parent_window (* SDL_Window))) "SDL_SetWindowModalFor")
(define-sdl-func int SDL_SetWindowInputFocus ((window (* SDL_Window))) "SDL_SetWindowInputFocus")
(define-sdl-func int SDL_SetWindowGammaRamp ((window (* SDL_Window)) (red (* Uint16)) (green (* Uint16)) (blue (* Uint16))) "SDL_SetWindowGammaRamp")
(define-sdl-func int SDL_GetWindowGammaRamp ((window (* SDL_Window)) (red (* Uint16)) (green (* Uint16)) (blue (* Uint16))) "SDL_GetWindowGammaRamp")
(define-sdl-func int SDL_SetWindowHitTest ((window (* SDL_Window)) (callback SDL_HitTest) (callback_data void*)) "SDL_SetWindowHitTest")
(define-sdl-func void SDL_DestroyWindow ((window (* SDL_Window))) "SDL_DestroyWindow")
(define-sdl-func SDL_bool SDL_IsScreenSaverEnabled () "SDL_IsScreenSaverEnabled")
(define-sdl-func void SDL_EnableScreenSaver () "SDL_EnableScreenSaver")
(define-sdl-func void SDL_DisableScreenSaver () "SDL_DisableScreenSaver")
(define-sdl-func int SDL_GL_LoadLibrary ((path string)) "SDL_GL_LoadLibrary")
(define-sdl-func void* SDL_GL_GetProcAddress ((proc string)) "SDL_GL_GetProcAddress")
(define-sdl-func void SDL_GL_UnloadLibrary () "SDL_GL_UnloadLibrary")
(define-sdl-func SDL_bool SDL_GL_ExtensionSupported ((extension string)) "SDL_GL_ExtensionSupported")
(define-sdl-func void SDL_GL_ResetAttributes () "SDL_GL_ResetAttributes")
(define-sdl-func int SDL_GL_SetAttribute ((attr SDL_GLattr) (value int)) "SDL_GL_SetAttribute")
(define-sdl-func int SDL_GL_GetAttribute ((attr SDL_GLattr) (value (* int))) "SDL_GL_GetAttribute")
(define-sdl-func SDL_GLContext SDL_GL_CreateContext ((window (* SDL_Window))) "SDL_GL_CreateContext")
(define-sdl-func int SDL_GL_MakeCurrent ((window (* SDL_Window)) (context SDL_GLContext)) "SDL_GL_MakeCurrent")
(define-sdl-func (* SDL_Window) SDL_GL_GetCurrentWindow () "SDL_GL_GetCurrentWindow")
(define-sdl-func SDL_GLContext SDL_GL_GetCurrentContext () "SDL_GL_GetCurrentContext")
(define-sdl-func void SDL_GL_GetDrawableSize ((window (* SDL_Window)) (w (* int)) (h (* int))) "SDL_GL_GetDrawableSize")
(define-sdl-func int SDL_GL_SetSwapInterval ((interval int)) "SDL_GL_SetSwapInterval")
(define-sdl-func int SDL_GL_GetSwapInterval () "SDL_GL_GetSwapInterval")
(define-sdl-func void SDL_GL_SwapWindow ((window (* SDL_Window))) "SDL_GL_SwapWindow")
(define-sdl-func void SDL_GL_DeleteContext ((context SDL_GLContext)) "SDL_GL_DeleteContext")
(define-sdl-func (* SDL_Window) SDL_GetKeyboardFocus () "SDL_GetKeyboardFocus")
(define-sdl-func (* Uint8) SDL_GetKeyboardState ((numkeys (* int))) "SDL_GetKeyboardState")
(define-sdl-func SDL_Keymod SDL_GetModState () "SDL_GetModState")
(define-sdl-func void SDL_SetModState ((modstate SDL_Keymod)) "SDL_SetModState")
(define-sdl-func SDL_Keycode SDL_GetKeyFromScancode ((scancode SDL_Scancode)) "SDL_GetKeyFromScancode")
(define-sdl-func SDL_Scancode SDL_GetScancodeFromKey ((key SDL_Keycode)) "SDL_GetScancodeFromKey")
(define-sdl-func string SDL_GetScancodeName ((scancode SDL_Scancode)) "SDL_GetScancodeName")
(define-sdl-func SDL_Scancode SDL_GetScancodeFromName ((name string)) "SDL_GetScancodeFromName")
(define-sdl-func string SDL_GetKeyName ((key SDL_Keycode)) "SDL_GetKeyName")
(define-sdl-func SDL_Keycode SDL_GetKeyFromName ((name string)) "SDL_GetKeyFromName")
(define-sdl-func void SDL_StartTextInput () "SDL_StartTextInput")
(define-sdl-func SDL_bool SDL_IsTextInputActive () "SDL_IsTextInputActive")
(define-sdl-func void SDL_StopTextInput () "SDL_StopTextInput")
(define-sdl-func void SDL_SetTextInputRect ((rect (* SDL_Rect))) "SDL_SetTextInputRect")
(define-sdl-func SDL_bool SDL_HasScreenKeyboardSupport () "SDL_HasScreenKeyboardSupport")
(define-sdl-func SDL_bool SDL_IsScreenKeyboardShown ((window (* SDL_Window))) "SDL_IsScreenKeyboardShown")
(define-sdl-func (* SDL_Window) SDL_GetMouseFocus () "SDL_GetMouseFocus")
(define-sdl-func Uint32 SDL_GetMouseState ((x (* int)) (y (* int))) "SDL_GetMouseState")
(define-sdl-func Uint32 SDL_GetGlobalMouseState ((x (* int)) (y (* int))) "SDL_GetGlobalMouseState")
(define-sdl-func Uint32 SDL_GetRelativeMouseState ((x (* int)) (y (* int))) "SDL_GetRelativeMouseState")
(define-sdl-func void SDL_WarpMouseInWindow ((window (* SDL_Window)) (x int) (y int)) "SDL_WarpMouseInWindow")
(define-sdl-func int SDL_WarpMouseGlobal ((x int) (y int)) "SDL_WarpMouseGlobal")
(define-sdl-func int SDL_SetRelativeMouseMode ((enabled SDL_bool)) "SDL_SetRelativeMouseMode")
(define-sdl-func int SDL_CaptureMouse ((enabled SDL_bool)) "SDL_CaptureMouse")
(define-sdl-func SDL_bool SDL_GetRelativeMouseMode () "SDL_GetRelativeMouseMode")
(define-sdl-func (* SDL_Cursor) SDL_CreateCursor ((data (* Uint8)) (mask (* Uint8)) (w int) (h int) (hot_x int) (hot_y int)) "SDL_CreateCursor")
(define-sdl-func (* SDL_Cursor) SDL_CreateColorCursor ((surface (* SDL_Surface)) (hot_x int) (hot_y int)) "SDL_CreateColorCursor")
(define-sdl-func (* SDL_Cursor) SDL_CreateSystemCursor ((id SDL_SystemCursor)) "SDL_CreateSystemCursor")
(define-sdl-func void SDL_SetCursor ((cursor (* SDL_Cursor))) "SDL_SetCursor")
(define-sdl-func (* SDL_Cursor) SDL_GetCursor () "SDL_GetCursor")
(define-sdl-func (* SDL_Cursor) SDL_GetDefaultCursor () "SDL_GetDefaultCursor")
(define-sdl-func void SDL_FreeCursor ((cursor (* SDL_Cursor))) "SDL_FreeCursor")
(define-sdl-func int SDL_ShowCursor ((toggle int)) "SDL_ShowCursor")
(define-sdl-func void SDL_LockJoysticks () "SDL_LockJoysticks")
(define-sdl-func void SDL_UnlockJoysticks () "SDL_UnlockJoysticks")
(define-sdl-func int SDL_NumJoysticks () "SDL_NumJoysticks")
(define-sdl-func string SDL_JoystickNameForIndex ((device_index int)) "SDL_JoystickNameForIndex")
(define-sdl-func (& SDL_JoystickGUID) SDL_JoystickGetDeviceGUID ((device_index int)) "SDL_JoystickGetDeviceGUID") ;chez-sdl返回了指针,thunder paser这个结果是#f,因为直接返回了结构体
(define-sdl-func Uint16 SDL_JoystickGetDeviceVendor ((device_index int)) "SDL_JoystickGetDeviceVendor")
(define-sdl-func Uint16 SDL_JoystickGetDeviceProduct ((device_index int)) "SDL_JoystickGetDeviceProduct")
(define-sdl-func Uint16 SDL_JoystickGetDeviceProductVersion ((device_index int)) "SDL_JoystickGetDeviceProductVersion")
(define-sdl-func SDL_JoystickType SDL_JoystickGetDeviceType ((device_index int)) "SDL_JoystickGetDeviceType")
(define-sdl-func SDL_JoystickID SDL_JoystickGetDeviceInstanceID ((device_index int)) "SDL_JoystickGetDeviceInstanceID")
(define-sdl-func (* SDL_Joystick) SDL_JoystickOpen ((device_index int)) "SDL_JoystickOpen")
(define-sdl-func (* SDL_Joystick) SDL_JoystickFromInstanceID ((joyid SDL_JoystickID)) "SDL_JoystickFromInstanceID")
(define-sdl-func string SDL_JoystickName ((joystick (* SDL_Joystick))) "SDL_JoystickName")
(define-sdl-func (& SDL_JoystickGUID) SDL_JoystickGetGUID ((joystick (* SDL_Joystick))) "SDL_JoystickGetGUID") ;返回值结构体变指针
(define-sdl-func Uint16 SDL_JoystickGetVendor ((joystick (* SDL_Joystick))) "SDL_JoystickGetVendor")
(define-sdl-func Uint16 SDL_JoystickGetProduct ((joystick (* SDL_Joystick))) "SDL_JoystickGetProduct")
(define-sdl-func Uint16 SDL_JoystickGetProductVersion ((joystick (* SDL_Joystick))) "SDL_JoystickGetProductVersion")
(define-sdl-func SDL_JoystickType SDL_JoystickGetType ((joystick (* SDL_Joystick))) "SDL_JoystickGetType")
(define-sdl-func void SDL_JoystickGetGUIDString ((guid (& SDL_JoystickGUID)) (pszGUID string) (cbGUID int)) "SDL_JoystickGetGUIDString") ;thunder #f,chez-sdl (& xx)
(define-sdl-func (& SDL_JoystickGUID) SDL_JoystickGetGUIDFromString ((pchGUID string)) "SDL_JoystickGetGUIDFromString")	;thunder #f,chez-sdl (& xx)
(define-sdl-func SDL_bool SDL_JoystickGetAttached ((joystick (* SDL_Joystick))) "SDL_JoystickGetAttached")
(define-sdl-func SDL_JoystickID SDL_JoystickInstanceID ((joystick (* SDL_Joystick))) "SDL_JoystickInstanceID")
(define-sdl-func int SDL_JoystickNumAxes ((joystick (* SDL_Joystick))) "SDL_JoystickNumAxes")
(define-sdl-func int SDL_JoystickNumBalls ((joystick (* SDL_Joystick))) "SDL_JoystickNumBalls")
(define-sdl-func int SDL_JoystickNumHats ((joystick (* SDL_Joystick))) "SDL_JoystickNumHats")
(define-sdl-func int SDL_JoystickNumButtons ((joystick (* SDL_Joystick))) "SDL_JoystickNumButtons")
(define-sdl-func void SDL_JoystickUpdate () "SDL_JoystickUpdate")
(define-sdl-func int SDL_JoystickEventState ((state int)) "SDL_JoystickEventState")
(define-sdl-func Sint16 SDL_JoystickGetAxis ((joystick (* SDL_Joystick)) (axis int)) "SDL_JoystickGetAxis")
(define-sdl-func SDL_bool SDL_JoystickGetAxisInitialState ((joystick (* SDL_Joystick)) (axis int) (state (* Sint16))) "SDL_JoystickGetAxisInitialState")
(define-sdl-func Uint8 SDL_JoystickGetHat ((joystick (* SDL_Joystick)) (hat int)) "SDL_JoystickGetHat")
(define-sdl-func int SDL_JoystickGetBall ((joystick (* SDL_Joystick)) (ball int) (dx (* int)) (dy (* int))) "SDL_JoystickGetBall")
(define-sdl-func Uint8 SDL_JoystickGetButton ((joystick (* SDL_Joystick)) (button int)) "SDL_JoystickGetButton")
(define-sdl-func void SDL_JoystickClose ((joystick (* SDL_Joystick))) "SDL_JoystickClose")
(define-sdl-func SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel ((joystick (* SDL_Joystick))) "SDL_JoystickCurrentPowerLevel")
(define-sdl-func int SDL_GameControllerAddMappingsFromRW ((rw (* SDL_RWops)) (freerw int)) "SDL_GameControllerAddMappingsFromRW")
(define-sdl-func int SDL_GameControllerAddMapping ((mappingString string)) "SDL_GameControllerAddMapping")
(define-sdl-func int SDL_GameControllerNumMappings () "SDL_GameControllerNumMappings")
(define-sdl-func string SDL_GameControllerMappingForIndex ((mapping_index int)) "SDL_GameControllerMappingForIndex")
(define-sdl-func string SDL_GameControllerMappingForGUID ((guid (& SDL_JoystickGUID))) "SDL_GameControllerMappingForGUID") ;thunder pase #f ,这里尝试了chez-sdl版本
(define-sdl-func string SDL_GameControllerMapping ((gamecontroller (* SDL_GameController))) "SDL_GameControllerMapping")
(define-sdl-func SDL_bool SDL_IsGameController ((joystick_index int)) "SDL_IsGameController")
(define-sdl-func string SDL_GameControllerNameForIndex ((joystick_index int)) "SDL_GameControllerNameForIndex")
(define-sdl-func (* SDL_GameController) SDL_GameControllerOpen ((joystick_index int)) "SDL_GameControllerOpen")
(define-sdl-func (* SDL_GameController) SDL_GameControllerFromInstanceID ((joyid SDL_JoystickID)) "SDL_GameControllerFromInstanceID")
(define-sdl-func string SDL_GameControllerName ((gamecontroller (* SDL_GameController))) "SDL_GameControllerName")
(define-sdl-func Uint16 SDL_GameControllerGetVendor ((gamecontroller (* SDL_GameController))) "SDL_GameControllerGetVendor")
(define-sdl-func Uint16 SDL_GameControllerGetProduct ((gamecontroller (* SDL_GameController))) "SDL_GameControllerGetProduct")
(define-sdl-func Uint16 SDL_GameControllerGetProductVersion ((gamecontroller (* SDL_GameController))) "SDL_GameControllerGetProductVersion")
(define-sdl-func SDL_bool SDL_GameControllerGetAttached ((gamecontroller (* SDL_GameController))) "SDL_GameControllerGetAttached")
(define-sdl-func (* SDL_Joystick) SDL_GameControllerGetJoystick ((gamecontroller (* SDL_GameController))) "SDL_GameControllerGetJoystick")
(define-sdl-func int SDL_GameControllerEventState ((state int)) "SDL_GameControllerEventState")
(define-sdl-func void SDL_GameControllerUpdate () "SDL_GameControllerUpdate")
(define-sdl-func SDL_GameControllerAxis SDL_GameControllerGetAxisFromString ((pchString string)) "SDL_GameControllerGetAxisFromString")
(define-sdl-func string SDL_GameControllerGetStringForAxis ((axis SDL_GameControllerAxis)) "SDL_GameControllerGetStringForAxis")
(define-sdl-func (& SDL_GameControllerButtonBind) SDL_GameControllerGetBindForAxis ((gamecontroller (* SDL_GameController)) (axis SDL_GameControllerAxis)) "SDL_GameControllerGetBindForAxis") ;thunder直接用了这个类型作为返回值,chez-sdl加了(& xx)
(define-sdl-func Sint16 SDL_GameControllerGetAxis ((gamecontroller (* SDL_GameController)) (axis SDL_GameControllerAxis)) "SDL_GameControllerGetAxis")
(define-sdl-func SDL_GameControllerButton SDL_GameControllerGetButtonFromString ((pchString string)) "SDL_GameControllerGetButtonFromString")
(define-sdl-func string SDL_GameControllerGetStringForButton ((button SDL_GameControllerButton)) "SDL_GameControllerGetStringForButton")
(define-sdl-func (& SDL_GameControllerButtonBind) SDL_GameControllerGetBindForButton ((gamecontroller (* SDL_GameController)) (button SDL_GameControllerButton)) "SDL_GameControllerGetBindForButton") ;thunder使用了ftype作为返回值,chez-sdl加了(& xx)
(define-sdl-func Uint8 SDL_GameControllerGetButton ((gamecontroller (* SDL_GameController)) (button SDL_GameControllerButton)) "SDL_GameControllerGetButton")
(define-sdl-func void SDL_GameControllerClose ((gamecontroller (* SDL_GameController))) "SDL_GameControllerClose")
(define-sdl-func int SDL_GetNumTouchDevices () "SDL_GetNumTouchDevices")
(define-sdl-func SDL_TouchID SDL_GetTouchDevice ((index int)) "SDL_GetTouchDevice")
(define-sdl-func int SDL_GetNumTouchFingers ((touchID SDL_TouchID)) "SDL_GetNumTouchFingers")
(define-sdl-func (* SDL_Finger) SDL_GetTouchFinger ((touchID SDL_TouchID) (index int)) "SDL_GetTouchFinger")
(define-sdl-func int SDL_RecordGesture ((touchId SDL_TouchID)) "SDL_RecordGesture")
(define-sdl-func int SDL_SaveAllDollarTemplates ((dst (* SDL_RWops))) "SDL_SaveAllDollarTemplates")
(define-sdl-func int SDL_SaveDollarTemplate ((gestureId SDL_GestureID) (dst (* SDL_RWops))) "SDL_SaveDollarTemplate")
(define-sdl-func int SDL_LoadDollarTemplates ((touchId SDL_TouchID) (src (* SDL_RWops))) "SDL_LoadDollarTemplates")
(define-sdl-func void SDL_PumpEvents () "SDL_PumpEvents")
(define-sdl-func int SDL_PeepEvents ((events (* SDL_Event)) (numevents int) (action SDL_eventaction) (minType Uint32) (maxType Uint32)) "SDL_PeepEvents")
(define-sdl-func SDL_bool SDL_HasEvent ((type Uint32)) "SDL_HasEvent")
(define-sdl-func SDL_bool SDL_HasEvents ((minType Uint32) (maxType Uint32)) "SDL_HasEvents")
(define-sdl-func void SDL_FlushEvent ((type Uint32)) "SDL_FlushEvent")
(define-sdl-func void SDL_FlushEvents ((minType Uint32) (maxType Uint32)) "SDL_FlushEvents")
(define-sdl-func int SDL_PollEvent ((event (* SDL_Event))) "SDL_PollEvent")
(define-sdl-func int SDL_WaitEvent ((event (* SDL_Event))) "SDL_WaitEvent")
(define-sdl-func int SDL_WaitEventTimeout ((event (* SDL_Event)) (timeout int)) "SDL_WaitEventTimeout")
(define-sdl-func int SDL_PushEvent ((event (* SDL_Event))) "SDL_PushEvent")
(define-sdl-func void SDL_SetEventFilter ((filter SDL_EventFilter) (userdata void*)) "SDL_SetEventFilter")
(define-sdl-func SDL_bool SDL_GetEventFilter ((filter (* SDL_EventFilter)) (userdata (* void*))) "SDL_GetEventFilter")
(define-sdl-func void SDL_AddEventWatch ((filter SDL_EventFilter) (userdata void*)) "SDL_AddEventWatch")
(define-sdl-func void SDL_DelEventWatch ((filter SDL_EventFilter) (userdata void*)) "SDL_DelEventWatch")
(define-sdl-func void SDL_FilterEvents ((filter SDL_EventFilter) (userdata void*)) "SDL_FilterEvents")
(define-sdl-func Uint8 SDL_EventState ((type Uint32) (state int)) "SDL_EventState")
(define-sdl-func Uint32 SDL_RegisterEvents ((numevents int)) "SDL_RegisterEvents")
(define-sdl-func string SDL_GetBasePath () "SDL_GetBasePath")
(define-sdl-func string SDL_GetPrefPath ((org string) (app string)) "SDL_GetPrefPath")
(define-sdl-func int SDL_NumHaptics () "SDL_NumHaptics")
(define-sdl-func string SDL_HapticName ((device_index int)) "SDL_HapticName")
(define-sdl-func (* SDL_Haptic) SDL_HapticOpen ((device_index int)) "SDL_HapticOpen")
(define-sdl-func int SDL_HapticOpened ((device_index int)) "SDL_HapticOpened")
(define-sdl-func int SDL_HapticIndex ((haptic (* SDL_Haptic))) "SDL_HapticIndex")
(define-sdl-func int SDL_MouseIsHaptic () "SDL_MouseIsHaptic")
(define-sdl-func (* SDL_Haptic) SDL_HapticOpenFromMouse () "SDL_HapticOpenFromMouse")
(define-sdl-func int SDL_JoystickIsHaptic ((joystick (* SDL_Joystick))) "SDL_JoystickIsHaptic")
(define-sdl-func (* SDL_Haptic) SDL_HapticOpenFromJoystick ((joystick (* SDL_Joystick))) "SDL_HapticOpenFromJoystick")
(define-sdl-func void SDL_HapticClose ((haptic (* SDL_Haptic))) "SDL_HapticClose")
(define-sdl-func int SDL_HapticNumEffects ((haptic (* SDL_Haptic))) "SDL_HapticNumEffects")
(define-sdl-func int SDL_HapticNumEffectsPlaying ((haptic (* SDL_Haptic))) "SDL_HapticNumEffectsPlaying")
(define-sdl-func unsigned-int SDL_HapticQuery ((haptic (* SDL_Haptic))) "SDL_HapticQuery")
(define-sdl-func int SDL_HapticNumAxes ((haptic (* SDL_Haptic))) "SDL_HapticNumAxes")
(define-sdl-func int SDL_HapticEffectSupported ((haptic (* SDL_Haptic)) (effect (* SDL_HapticEffect))) "SDL_HapticEffectSupported")
(define-sdl-func int SDL_HapticNewEffect ((haptic (* SDL_Haptic)) (effect (* SDL_HapticEffect))) "SDL_HapticNewEffect")
(define-sdl-func int SDL_HapticUpdateEffect ((haptic (* SDL_Haptic)) (effect int) (data (* SDL_HapticEffect))) "SDL_HapticUpdateEffect")
(define-sdl-func int SDL_HapticRunEffect ((haptic (* SDL_Haptic)) (effect int) (iterations Uint32)) "SDL_HapticRunEffect")
(define-sdl-func int SDL_HapticStopEffect ((haptic (* SDL_Haptic)) (effect int)) "SDL_HapticStopEffect")
(define-sdl-func void SDL_HapticDestroyEffect ((haptic (* SDL_Haptic)) (effect int)) "SDL_HapticDestroyEffect")
(define-sdl-func int SDL_HapticGetEffectStatus ((haptic (* SDL_Haptic)) (effect int)) "SDL_HapticGetEffectStatus")
(define-sdl-func int SDL_HapticSetGain ((haptic (* SDL_Haptic)) (gain int)) "SDL_HapticSetGain")
(define-sdl-func int SDL_HapticSetAutocenter ((haptic (* SDL_Haptic)) (autocenter int)) "SDL_HapticSetAutocenter")
(define-sdl-func int SDL_HapticPause ((haptic (* SDL_Haptic))) "SDL_HapticPause")
(define-sdl-func int SDL_HapticUnpause ((haptic (* SDL_Haptic))) "SDL_HapticUnpause")
(define-sdl-func int SDL_HapticStopAll ((haptic (* SDL_Haptic))) "SDL_HapticStopAll")
(define-sdl-func int SDL_HapticRumbleSupported ((haptic (* SDL_Haptic))) "SDL_HapticRumbleSupported")
(define-sdl-func int SDL_HapticRumbleInit ((haptic (* SDL_Haptic))) "SDL_HapticRumbleInit")
(define-sdl-func int SDL_HapticRumblePlay ((haptic (* SDL_Haptic)) (strength float) (length Uint32)) "SDL_HapticRumblePlay")
(define-sdl-func int SDL_HapticRumbleStop ((haptic (* SDL_Haptic))) "SDL_HapticRumbleStop")
(define-sdl-func SDL_bool SDL_SetHintWithPriority ((name string) (value string) (priority SDL_HintPriority)) "SDL_SetHintWithPriority")
(define-sdl-func SDL_bool SDL_SetHint ((name string) (value string)) "SDL_SetHint")
(define-sdl-func string SDL_GetHint ((name string)) "SDL_GetHint")
(define-sdl-func SDL_bool SDL_GetHintBoolean ((name string) (default_value SDL_bool)) "SDL_GetHintBoolean")
(define-sdl-func void SDL_AddHintCallback ((name string) (callback SDL_HintCallback) (userdata void*)) "SDL_AddHintCallback")
(define-sdl-func void SDL_DelHintCallback ((name string) (callback SDL_HintCallback) (userdata void*)) "SDL_DelHintCallback")
(define-sdl-func void SDL_ClearHints () "SDL_ClearHints")
(define-sdl-func void* SDL_LoadObject ((sofile string)) "SDL_LoadObject")
(define-sdl-func void* SDL_LoadFunction ((handle void*) (name string)) "SDL_LoadFunction")
(define-sdl-func void SDL_UnloadObject ((handle void*)) "SDL_UnloadObject")
(define-sdl-func void SDL_LogSetAllPriority ((priority SDL_LogPriority)) "SDL_LogSetAllPriority")
(define-sdl-func void SDL_LogSetPriority ((category int) (priority SDL_LogPriority)) "SDL_LogSetPriority")
(define-sdl-func SDL_LogPriority SDL_LogGetPriority ((category int)) "SDL_LogGetPriority")
(define-sdl-func void SDL_LogResetPriorities () "SDL_LogResetPriorities")
(define-sdl-func void SDL_Log ((fmt string)) "SDL_Log")
(define-sdl-func void SDL_LogVerbose ((category int) (fmt string)) "SDL_LogVerbose")
(define-sdl-func void SDL_LogDebug ((category int) (fmt string)) "SDL_LogDebug")
(define-sdl-func void SDL_LogInfo ((category int) (fmt string)) "SDL_LogInfo")
(define-sdl-func void SDL_LogWarn ((category int) (fmt string)) "SDL_LogWarn")
(define-sdl-func void SDL_LogError ((category int) (fmt string)) "SDL_LogError")
(define-sdl-func void SDL_LogCritical ((category int) (fmt string)) "SDL_LogCritical")
(define-sdl-func void SDL_LogMessage ((category int) (priority SDL_LogPriority) (fmt string)) "SDL_LogMessage")
(define-sdl-func void SDL_LogMessageV ((category int) (priority SDL_LogPriority) (fmt string) (ap va_list)) "SDL_LogMessageV")
(define-sdl-func void SDL_LogGetOutputFunction ((callback (* SDL_LogOutputFunction)) (userdata (* void*))) "SDL_LogGetOutputFunction")
(define-sdl-func void SDL_LogSetOutputFunction ((callback SDL_LogOutputFunction) (userdata void*)) "SDL_LogSetOutputFunction")
(define-sdl-func int SDL_ShowMessageBox ((messageboxdata (* SDL_MessageBoxData)) (buttonid (* int))) "SDL_ShowMessageBox")
(define-sdl-func int SDL_ShowSimpleMessageBox ((flags Uint32) (title string) (message string) (window (* SDL_Window))) "SDL_ShowSimpleMessageBox")
(define-sdl-func SDL_PowerState SDL_GetPowerInfo ((secs (* int)) (pct (* int))) "SDL_GetPowerInfo")
(define-sdl-func int SDL_GetNumRenderDrivers () "SDL_GetNumRenderDrivers")
(define-sdl-func int SDL_GetRenderDriverInfo ((index int) (info (* SDL_RendererInfo))) "SDL_GetRenderDriverInfo")
(define-sdl-func int SDL_CreateWindowAndRenderer ((width int) (height int) (window_flags Uint32) (window (* SDL_Window)) (renderer (* SDL_Renderer))) "SDL_CreateWindowAndRenderer")
(define-sdl-func (* SDL_Renderer) SDL_CreateRenderer ((window (* SDL_Window)) (index int) (flags Uint32)) "SDL_CreateRenderer")
(define-sdl-func (* SDL_Renderer) SDL_CreateSoftwareRenderer ((surface (* SDL_Surface))) "SDL_CreateSoftwareRenderer")
(define-sdl-func (* SDL_Renderer) SDL_GetRenderer ((window (* SDL_Window))) "SDL_GetRenderer")
(define-sdl-func int SDL_GetRendererInfo ((renderer (* SDL_Renderer)) (info (* SDL_RendererInfo))) "SDL_GetRendererInfo")
(define-sdl-func int SDL_GetRendererOutputSize ((renderer (* SDL_Renderer)) (w (* int)) (h (* int))) "SDL_GetRendererOutputSize")
(define-sdl-func (* SDL_Texture) SDL_CreateTexture ((renderer (* SDL_Renderer)) (format Uint32) (access int) (w int) (h int)) "SDL_CreateTexture")
(define-sdl-func (* SDL_Texture) SDL_CreateTextureFromSurface ((renderer (* SDL_Renderer)) (surface (* SDL_Surface))) "SDL_CreateTextureFromSurface")
(define-sdl-func int SDL_QueryTexture ((texture (* SDL_Texture)) (format (* Uint32)) (access (* int)) (w (* int)) (h (* int))) "SDL_QueryTexture")
(define-sdl-func int SDL_SetTextureColorMod ((texture (* SDL_Texture)) (r Uint8) (g Uint8) (b Uint8)) "SDL_SetTextureColorMod")
(define-sdl-func int SDL_GetTextureColorMod ((texture (* SDL_Texture)) (r (* Uint8)) (g (* Uint8)) (b (* Uint8))) "SDL_GetTextureColorMod")
(define-sdl-func int SDL_SetTextureAlphaMod ((texture (* SDL_Texture)) (alpha Uint8)) "SDL_SetTextureAlphaMod")
(define-sdl-func int SDL_GetTextureAlphaMod ((texture (* SDL_Texture)) (alpha (* Uint8))) "SDL_GetTextureAlphaMod")
(define-sdl-func int SDL_SetTextureBlendMode ((texture (* SDL_Texture)) (blendMode SDL_BlendMode)) "SDL_SetTextureBlendMode")
(define-sdl-func int SDL_GetTextureBlendMode ((texture (* SDL_Texture)) (blendMode (* SDL_BlendMode))) "SDL_GetTextureBlendMode")
(define-sdl-func int SDL_UpdateTexture ((texture (* SDL_Texture)) (rect (* SDL_Rect)) (pixels void*) (pitch int)) "SDL_UpdateTexture")
(define-sdl-func int SDL_UpdateYUVTexture ((texture (* SDL_Texture)) (rect (* SDL_Rect)) (Yplane (* Uint8)) (Ypitch int) (Uplane (* Uint8)) (Upitch int) (Vplane (* Uint8)) (Vpitch int)) "SDL_UpdateYUVTexture")
(define-sdl-func int SDL_LockTexture ((texture (* SDL_Texture)) (rect (* SDL_Rect)) (pixels (* void*)) (pitch (* int))) "SDL_LockTexture")
(define-sdl-func void SDL_UnlockTexture ((texture (* SDL_Texture))) "SDL_UnlockTexture")
(define-sdl-func SDL_bool SDL_RenderTargetSupported ((renderer (* SDL_Renderer))) "SDL_RenderTargetSupported")
(define-sdl-func int SDL_SetRenderTarget ((renderer (* SDL_Renderer)) (texture (* SDL_Texture))) "SDL_SetRenderTarget")
(define-sdl-func (* SDL_Texture) SDL_GetRenderTarget ((renderer (* SDL_Renderer))) "SDL_GetRenderTarget")
(define-sdl-func int SDL_RenderSetLogicalSize ((renderer (* SDL_Renderer)) (w int) (h int)) "SDL_RenderSetLogicalSize")
(define-sdl-func void SDL_RenderGetLogicalSize ((renderer (* SDL_Renderer)) (w (* int)) (h (* int))) "SDL_RenderGetLogicalSize")
(define-sdl-func int SDL_RenderSetIntegerScale ((renderer (* SDL_Renderer)) (enable SDL_bool)) "SDL_RenderSetIntegerScale")
(define-sdl-func SDL_bool SDL_RenderGetIntegerScale ((renderer (* SDL_Renderer))) "SDL_RenderGetIntegerScale")
(define-sdl-func int SDL_RenderSetViewport ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderSetViewport")
(define-sdl-func void SDL_RenderGetViewport ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderGetViewport")
(define-sdl-func int SDL_RenderSetClipRect ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderSetClipRect")
(define-sdl-func void SDL_RenderGetClipRect ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderGetClipRect")
(define-sdl-func SDL_bool SDL_RenderIsClipEnabled ((renderer (* SDL_Renderer))) "SDL_RenderIsClipEnabled")
(define-sdl-func int SDL_RenderSetScale ((renderer (* SDL_Renderer)) (scaleX float) (scaleY float)) "SDL_RenderSetScale")
(define-sdl-func void SDL_RenderGetScale ((renderer (* SDL_Renderer)) (scaleX (* float)) (scaleY (* float))) "SDL_RenderGetScale")
(define-sdl-func int SDL_SetRenderDrawColor ((renderer (* SDL_Renderer)) (r Uint8) (g Uint8) (b Uint8) (a Uint8)) "SDL_SetRenderDrawColor")
(define-sdl-func int SDL_GetRenderDrawColor ((renderer (* SDL_Renderer)) (r (* Uint8)) (g (* Uint8)) (b (* Uint8)) (a (* Uint8))) "SDL_GetRenderDrawColor")
(define-sdl-func int SDL_SetRenderDrawBlendMode ((renderer (* SDL_Renderer)) (blendMode SDL_BlendMode)) "SDL_SetRenderDrawBlendMode")
(define-sdl-func int SDL_GetRenderDrawBlendMode ((renderer (* SDL_Renderer)) (blendMode (* SDL_BlendMode))) "SDL_GetRenderDrawBlendMode")
(define-sdl-func int SDL_RenderClear ((renderer (* SDL_Renderer))) "SDL_RenderClear")
(define-sdl-func int SDL_RenderDrawPoint ((renderer (* SDL_Renderer)) (x int) (y int)) "SDL_RenderDrawPoint")
(define-sdl-func int SDL_RenderDrawPoints ((renderer (* SDL_Renderer)) (points (* SDL_Point)) (count int)) "SDL_RenderDrawPoints")
(define-sdl-func int SDL_RenderDrawLine ((renderer (* SDL_Renderer)) (x1 int) (y1 int) (x2 int) (y2 int)) "SDL_RenderDrawLine")
(define-sdl-func int SDL_RenderDrawLines ((renderer (* SDL_Renderer)) (points (* SDL_Point)) (count int)) "SDL_RenderDrawLines")
(define-sdl-func int SDL_RenderDrawRect ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderDrawRect")
(define-sdl-func int SDL_RenderDrawRects ((renderer (* SDL_Renderer)) (rects (* SDL_Rect)) (count int)) "SDL_RenderDrawRects")
(define-sdl-func int SDL_RenderFillRect ((renderer (* SDL_Renderer)) (rect (* SDL_Rect))) "SDL_RenderFillRect")
(define-sdl-func int SDL_RenderFillRects ((renderer (* SDL_Renderer)) (rects (* SDL_Rect)) (count int)) "SDL_RenderFillRects")
(define-sdl-func int SDL_RenderCopy ((renderer (* SDL_Renderer)) (texture (* SDL_Texture)) (srcrect (* SDL_Rect)) (dstrect (* SDL_Rect))) "SDL_RenderCopy")
(define-sdl-func int SDL_RenderCopyEx ((renderer (* SDL_Renderer)) (texture (* SDL_Texture)) (srcrect (* SDL_Rect)) (dstrect (* SDL_Rect)) (angle double) (center (* SDL_Point)) (flip int)) "SDL_RenderCopyEx") ;thunder 风格下,flag的本质类型没有暴露出来,直接用了原昵称-t.... 2023年2月28日23:04:02
(define-sdl-func int SDL_RenderReadPixels ((renderer (* SDL_Renderer)) (rect (* SDL_Rect)) (format Uint32) (pixels void*) (pitch int)) "SDL_RenderReadPixels")
(define-sdl-func void SDL_RenderPresent ((renderer (* SDL_Renderer))) "SDL_RenderPresent")
(define-sdl-func void SDL_DestroyTexture ((texture (* SDL_Texture))) "SDL_DestroyTexture")
(define-sdl-func void SDL_DestroyRenderer ((renderer (* SDL_Renderer))) "SDL_DestroyRenderer")
(define-sdl-func int SDL_GL_BindTexture ((texture (* SDL_Texture)) (texw (* float)) (texh (* float))) "SDL_GL_BindTexture")
(define-sdl-func int SDL_GL_UnbindTexture ((texture (* SDL_Texture))) "SDL_GL_UnbindTexture")
(define-sdl-func (* SDL_Window) SDL_CreateShapedWindow ((title string) (x unsigned-int) (y unsigned-int) (w unsigned-int) (h unsigned-int) (flags Uint32)) "SDL_CreateShapedWindow")
(define-sdl-func SDL_bool SDL_IsShapedWindow ((window (* SDL_Window))) "SDL_IsShapedWindow")
(define-sdl-func int SDL_SetWindowShape ((window (* SDL_Window)) (shape (* SDL_Surface)) (shape_mode (* SDL_WindowShapeMode))) "SDL_SetWindowShape")
(define-sdl-func int SDL_GetShapedWindowMode ((window (* SDL_Window)) (shape_mode (* SDL_WindowShapeMode))) "SDL_GetShapedWindowMode")
(define-sdl-func Uint32 SDL_GetTicks () "SDL_GetTicks")
(define-sdl-func Uint64 SDL_GetPerformanceCounter () "SDL_GetPerformanceCounter")
(define-sdl-func Uint64 SDL_GetPerformanceFrequency () "SDL_GetPerformanceFrequency")
(define-sdl-func void SDL_Delay ((ms Uint32)) "SDL_Delay")
(define-sdl-func SDL_TimerID SDL_AddTimer ((interval Uint32) (callback SDL_TimerCallback) (param void*)) "SDL_AddTimer")
(define-sdl-func SDL_bool SDL_RemoveTimer ((id SDL_TimerID)) "SDL_RemoveTimer")
(define-sdl-func void SDL_GetVersion ((ver (* SDL_version))) "SDL_GetVersion")
(define-sdl-func string SDL_GetRevision () "SDL_GetRevision")
(define-sdl-func int SDL_GetRevisionNumber () "SDL_GetRevisionNumber")
(define-sdl-func int SDL_Init ((flags Uint32)) "SDL_Init")
(define-sdl-func int SDL_InitSubSystem ((flags Uint32)) "SDL_InitSubSystem")
(define-sdl-func void SDL_QuitSubSystem ((flags Uint32)) "SDL_QuitSubSystem")
(define-sdl-func Uint32 SDL_WasInit ((flags Uint32)) "SDL_WasInit")
(define-sdl-func void SDL_Quit () "SDL_Quit")

;;; extend
(define-sdl-func int SDL_RenderCopyExF
  ((render SDL_Renderer) (texture SDL_Texture) (srcrect (* SDL_FRect)) (dstrect (* SDL_FRect)) (angle double) (center (* SDL_FPoint)) (flip int))
  "SDL_RenderCopyExF") ;这个应该是看b站时候扩展的,最后一个int参数,在sdlwiki是SDL_RendererFlip,是个flag,本质是int,上面(& )了的很可能类似  2023年2月28日23:02:04
